package com.woniu.service.impl;

import com.woniu.dao.CollectServiceMapper;
import com.woniu.dao.PropertyPaydtoMapper;
import com.woniu.pojo.CollectService;
import com.woniu.pojo.Propertypaydto;
import com.woniu.service.ServiceCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceCollectServiceimpl implements ServiceCollectService {

    @Autowired
    private CollectServiceMapper collectServiceMapper;

    @Autowired
    private PropertyPaydtoMapper propertyPaydtoMapper;

    @Override
    public void addCollectService(CollectService collectService) {
        collectServiceMapper.insert(collectService);
    }

    @Override
    public List<Propertypaydto> selectCollectService(Integer userid) {
         return propertyPaydtoMapper.selectcollectPayByUserId(userid);
    }

    @Override
    public void deleteCollectService(Integer serviceid,Integer userid) {
        collectServiceMapper.deleteByuserIdAndServiceId(serviceid,userid);
    }

    @Override
    public Integer selectserviceidByuserid(Integer userid) {
        return collectServiceMapper.selectServiceIdByUserId(userid);
    }
}
